1. Field of the Invention
The present invention relates to a data processing method, and more particularly, to a data caching method and a computer-readable medium storing a program executing the method.
2. Description of the Related Art
It is an important subject of how to obtain optimum efficiency of data processing in the real world where the data are frequently exchanged.
The data storing operation is an indispensable step during data processing. According to the different locations of the storage devices in the current data storage systems, the data storage system is roughly classified into two types: the network storage device and the single storage device. In the single storage device, based on the different access rates, the data storage device may be classified as the optical disc, the general memory, and the cache memory. Under the premise of the same capacity, the higher the access rate, the higher the cost of the storage device. Accordingly, if the optimum processing speed is obtained with the lowest cost, the efficiency of the data processing is undoubtedly improved.
In order to improve the data processing efficiency, many studies on the data processing in the cache memory had been made in the prior art. For example, different methods for replacing data in the cache memory had been disclosed in the U.S. Pat. No. 6,785,770 and US Patent Application No. 20020078300, respectively. However, the method for replacing data in the cache memory are mainly based on two different rules, they are the Least-Recently Used (LRU) rule and the Lease-Frequently Used (LFU) rule. Wherein, the LRU rule relies on the number of data usage to determine whether to delete the data from the cache memory, and the LFU rule relies on the frequency of data usage to determine whether to delete data from the cache memory.
However, the data processing rules mentioned above only consider the performance of the data processing rather than considering the resource consumed in fetching the data (including the consumed resource such as the time cost, the space cost, and the priority level, etc.). For example, once data, which is less frequently used but takes multiplied time to fetch when compared with other data, had been deleted from the cache memory, the time cost consumed in fetching the data again from the cache memory is multiple of that for fetching other data. Consequently, if the resource consumed in fetching the data is not accounted for, the efficiency of data processing is hard to improve.
In the patent and patent application mentioned above, some technology dose take the resource consumed in fetching the data into consideration, and also converts this concept to the actual data replacing structure. Although such invention is not so bad, it cannot be applied on the conventional cache system structure without changing it.